<?php
/**
 * Yii view index
 *
 * @author <KTD SOFT>
 * @since Jan 10, 2013 - 2:05:24 AM
 */
$this->beginwidget('DataTable', array(
    'model'       => $this->model,
    'title'       => Yii::t('services', 'Services'),
    'fieldSearch' => 'title',
    'columns'     => array(
        'title',
        array(
            'name'  => Yii::t('services', 'Category'),
            'value' => '$data->serviceCategory->name',
        ),
        array(
            'name'  => Yii::t('datatable', 'Create At'),
            'value' => 'MyUtil::timeToString($data->created->created_at)',
        ),
        array(
            'name'  => Yii::t('datatable', 'Create By'),
            'value' => '$data->created->admin->username',
        ),
        array(
            'name'  => Yii::t('datatable', 'Status'),
            'value' => '$data->statusLabel',
        ),
        array(
            'name'  => Yii::t('datatable', 'Update At'),
            'value' => 'MyUtil::timeToString($data->updated->created_at)',
        ),
        array(
            'name'  => Yii::t('datatable', 'Update By'),
            'value' => '$data->updated->admin->username',
        ),
    ),
));
?>
<?php if (Admin::checkAccess('create', 'Services')): ?>
    <a href="<?php
    echo $this->createUrl('services/create', array(
        'lang' => $this->lang,
    ))
    ?>">
        <button class="btn btn-primary" style="margin-top: 10px; margin-bottom: -18px;">
            <i class="icon icon-plus" style="padding-right:4px;"></i>Thêm mới</button>
    </a>
<?php endif; ?>
<?php $this->endWidget() ?>
